import requests
import datetime
import json
import os
res = requests.post('http://localhost:5000/roleM',data={'name':'市场专员'})
mes = json.loads(res.text)
if mes['code'] != 200:
    #写测试报告
    filename = datetime.datetime.strftime(datetime.datetime.now(),'%Y%m%d')
    with open(os.path.join('../logs/'+filename+'.txt'),'a+') as f:
        str = "请求的接口是:http://localhost:5000/roleM,返回结果:"+res.text
        f.write(str)